3.11 \(\int \frac {(a+b x^2)^2}{c+d x^2} \, dx\)

Optimal. Leaf size=63 \[ \frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{5/2}}-\frac {b x (b c-2 a d)}{d^2}+\frac {b^2 x^3}{3 d} \]

[Out]

-b*(-2*a*d+b*c)*x/d^2+1/3*b^2*x^3/d+(-a*d+b*c)^2*arctan(x*d^(1/2)/c^(1/2))/d^(5/2)/c^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {390, 205} \[ -\frac {b x (b c-2 a d)}{d^2}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{5/2}}+\frac {b^2 x^3}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)^2/(c + d*x^2),x]

[Out]

-((b*(b*c - 2*a*d)*x)/d^2) + (b^2*x^3)/(3*d) + ((b*c - a*d)^2*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(Sqrt[c]*d^(5/2))

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rubi steps

\begin {align*} \int \frac {\left (a+b x^2\right )^2}{c+d x^2} \, dx &=\int \left (-\frac {b (b c-2 a d)}{d^2}+\frac {b^2 x^2}{d}+\frac {b^2 c^2-2 a b c d+a^2 d^2}{d^2 \left (c+d x^2\right )}\right ) \, dx\\ &=-\frac {b (b c-2 a d) x}{d^2}+\frac {b^2 x^3}{3 d}+\frac {(b c-a d)^2 \int \frac {1}{c+d x^2} \, dx}{d^2}\\ &=-\frac {b (b c-2 a d) x}{d^2}+\frac {b^2 x^3}{3 d}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{5/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 59, normalized size = 0.94 \[ \frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{5/2}}+\frac {b x \left (6 a d-3 b c+b d x^2\right )}{3 d^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)^2/(c + d*x^2),x]

[Out]

(b*x*(-3*b*c + 6*a*d + b*d*x^2))/(3*d^2) + ((b*c - a*d)^2*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(Sqrt[c]*d^(5/2))

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 179, normalized size = 2.84 \[ \left [\frac {2 \, b^{2} c d^{2} x^{3} - 3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-c d} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right ) - 6 \, {\left (b^{2} c^{2} d - 2 \, a b c d^{2}\right )} x}{6 \, c d^{3}}, \frac {b^{2} c d^{2} x^{3} + 3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right ) - 3 \, {\left (b^{2} c^{2} d - 2 \, a b c d^{2}\right )} x}{3 \, c d^{3}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2/(d*x^2+c),x, algorithm="fricas")

[Out]

[1/6*(2*b^2*c*d^2*x^3 - 3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(-c*d)*log((d*x^2 - 2*sqrt(-c*d)*x - c)/(d*x^2 +
 c)) - 6*(b^2*c^2*d - 2*a*b*c*d^2)*x)/(c*d^3), 1/3*(b^2*c*d^2*x^3 + 3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(c*d
)*arctan(sqrt(c*d)*x/c) - 3*(b^2*c^2*d - 2*a*b*c*d^2)*x)/(c*d^3)]

________________________________________________________________________________________

giac [A]  time = 0.59, size = 72, normalized size = 1.14 \[ \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} d^{2}} + \frac {b^{2} d^{2} x^{3} - 3 \, b^{2} c d x + 6 \, a b d^{2} x}{3 \, d^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2/(d*x^2+c),x, algorithm="giac")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*d^2) + 1/3*(b^2*d^2*x^3 - 3*b^2*c*d*x + 6*a*b
*d^2*x)/d^3

________________________________________________________________________________________

maple [A]  time = 0.00, size = 95, normalized size = 1.51 \[ \frac {b^{2} x^{3}}{3 d}+\frac {a^{2} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d}}-\frac {2 a b c \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d}\, d}+\frac {b^{2} c^{2} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d}\, d^{2}}+\frac {2 a b x}{d}-\frac {b^{2} c x}{d^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)^2/(d*x^2+c),x)

[Out]

1/3*b^2*x^3/d+2*b/d*a*x-b^2/d^2*x*c+1/(c*d)^(1/2)*arctan(1/(c*d)^(1/2)*d*x)*a^2-2/d/(c*d)^(1/2)*arctan(1/(c*d)
^(1/2)*d*x)*a*b*c+1/d^2/(c*d)^(1/2)*arctan(1/(c*d)^(1/2)*d*x)*b^2*c^2

________________________________________________________________________________________

maxima [A]  time = 2.89, size = 68, normalized size = 1.08 \[ \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} d^{2}} + \frac {b^{2} d x^{3} - 3 \, {\left (b^{2} c - 2 \, a b d\right )} x}{3 \, d^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)^2/(d*x^2+c),x, algorithm="maxima")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*d^2) + 1/3*(b^2*d*x^3 - 3*(b^2*c - 2*a*b*d)*x
)/d^2

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 90, normalized size = 1.43 \[ \frac {b^2\,x^3}{3\,d}-x\,\left (\frac {b^2\,c}{d^2}-\frac {2\,a\,b}{d}\right )+\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,{\left (a\,d-b\,c\right )}^2}{\sqrt {c}\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,{\left (a\,d-b\,c\right )}^2}{\sqrt {c}\,d^{5/2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^2)^2/(c + d*x^2),x)

[Out]

(b^2*x^3)/(3*d) - x*((b^2*c)/d^2 - (2*a*b)/d) + (atan((d^(1/2)*x*(a*d - b*c)^2)/(c^(1/2)*(a^2*d^2 + b^2*c^2 -
2*a*b*c*d)))*(a*d - b*c)^2)/(c^(1/2)*d^(5/2))

________________________________________________________________________________________

sympy [B]  time = 0.42, size = 172, normalized size = 2.73 \[ \frac {b^{2} x^{3}}{3 d} + x \left (\frac {2 a b}{d} - \frac {b^{2} c}{d^{2}}\right ) - \frac {\sqrt {- \frac {1}{c d^{5}}} \left (a d - b c\right )^{2} \log {\left (- \frac {c d^{2} \sqrt {- \frac {1}{c d^{5}}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{c d^{5}}} \left (a d - b c\right )^{2} \log {\left (\frac {c d^{2} \sqrt {- \frac {1}{c d^{5}}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)**2/(d*x**2+c),x)

[Out]

b**2*x**3/(3*d) + x*(2*a*b/d - b**2*c/d**2) - sqrt(-1/(c*d**5))*(a*d - b*c)**2*log(-c*d**2*sqrt(-1/(c*d**5))*(
a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d + b**2*c**2) + x)/2 + sqrt(-1/(c*d**5))*(a*d - b*c)**2*log(c*d**2*sqrt(-1
/(c*d**5))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d + b**2*c**2) + x)/2

________________________________________________________________________________________